package hongcaosp.app.android.user.settings.info;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.alibaba.fastjson.JSONObject;

import hongcaosp.app.android.R;
import hongcaosp.app.android.common.BaseHolder;
import xlj.lib.android.base.view.OnRecycleItemClickListener;

/**
 * 选择性别
 */
public class UserinfoSexHolder extends BaseHolder<JSONObject> {

    private TextView tv_content;
    private ImageView iv_status;

    public UserinfoSexHolder(View itemView, OnRecycleItemClickListener recycleItemClickListener) {
        super(itemView, recycleItemClickListener);
        tv_content = itemView.findViewById(R.id.tv_content);
        iv_status = itemView.findViewById(R.id.iv_status);
    }

    @Override
    public void setData(JSONObject jsonObject) {
        super.setData(jsonObject);

        String content = jsonObject.getString("content");
        int status = jsonObject.getIntValue("status");

        tv_content.setText(content);
        iv_status.setImageResource(status == 0 ? 0 : R.drawable.icon_tick_white);
    }
}
